const express = require('express');
const { adminController } = require('../controllers');
const { auth, authorize } = require('../middleware/auth');
const validate = require('../middleware/validate');
const adminValidation = require('../validators/admin.validation');

const router = express.Router();

// 管理员登录
router.post('/login', validate(adminValidation.login), adminController.loginAdmin);

// 需要管理员权限的路由
router
  .route('/:adminId')
  .get(auth(), authorize(['user_manage']), adminController.getAdminInfo);

module.exports = router; 